<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>入职申请</title>
    <script src="../../../../res/js/jquery-3.4.1.min.js" charset="utf-8"></script>
    <script src="../../../../res/js/login_common.js" charset="utf-8"></script>
    <script src="../../../../res/layui/layui.js" charset="utf-8"></script>
    <script src="../../../../res/js/Tools.js" charset="utf-8"></script>
    <link rel="shortcut icon" type="image/x-icon" href="../../../../res/images/favicon.ico">
    <link rel="stylesheet" href="../../../../res/layui/css/layui.css" media="all">
    <style>
        .titles {
            font-weight: bold;
        }
    </style>
</head>
<body style="padding: 10px">
<form action="" class="layui-form layui-form-pane">
    <!--<h1 align="center" style="margin-bottom: 20px"></h1>-->
    <input name="pkEntryId" id="pkEntryId" type="hidden"/>
    <input name="isRevision" id="isRevision" type="hidden"/>
    <table border="1px" style="width: 630px;text-align: center;height: 891px;margin: 10px auto">
        <tbody>
        <tr>
            <td colspan="8" style="font-size: 30px">
                员工入职登记表
            </td>
        </tr>
        <tr>
            <td style="width: 70px" class="titles">
                姓名
            </td>
            <td style="width: 65px">
                周菜菜
            </td>
            <td style="width: 65px" class="titles">
                民族
            </td>
            <td style="width: 65px">
                保安族
            </td>
            <td style="width: 65px" class="titles">
                出生日期
            </td>
            <td style="width: 100px">
                yyyy-MM-dd
            </td>
            <td class="titles">
                电话
            </td>
            <td>
                12313241234
            </td>
        </tr>
        <tr>
            <td class="titles">
                籍贯
            </td>
            <td>
                湖南娄底
            </td>
            <td class="titles">
                最高学历
            </td>
            <td>
                博士
            </td>
            <td style="width: 75px" class="titles">
                户口所在地
            </td>
            <td colspan="3">
                湖南省娄底市娄星区竹山居委会四组
            </td>
        </tr>
        <tr>
            <td class="titles">
                专业
            </td>
            <td>
                挖掘机
            </td>
            <td class="titles">
                外语等级
            </td>
            <td>
                英语8级
            </td>
            <td class="titles">
                职业资格
            </td>
            <td>
                计算机资格证
            </td>
            <td class="titles">
                专业职称
            </td>
            <td>
                网络工程师
            </td>
        </tr>
        <tr>
            <td class="titles">
                性别
            </td>
            <td>
                男
            </td>
            <td class="titles">
                婚姻状况
            </td>
            <td>
                未婚
            </td>
            <td class="titles">
                参加工作时间
            </td>
            <td>
                yyyy-MM-dd
            </td>
            <td class="titles">
                应聘来源
            </td>
            <td>
                朋友介绍
            </td>
        </tr>
        <tr>
            <td class="titles">
                入职部门
            </td>
            <td>
                研发部
            </td>
            <td class="titles">
                入职岗位
            </td>
            <td colspan="2">
                程序员
            </td>
            <td class="titles" colspan="2">
                累计工作时间
            </td>
            <td>
                3年05月
            </td>
        </tr>
        <tr>
            <td class="titles">
                邮编
            </td>
            <td>
                471000
            </td>
            <td class="titles">
                通信地址
            </td>
            <td colspan="5">
                湖南省娄底市娄星区竹山居委会四组
            </td>
        </tr>
        <tr>
            <td class="titles">
                邮编
            </td>
            <td>
                471000
            </td>
            <td class="titles">
                现住地址
            </td>
            <td colspan="5">
                湖南省娄底市娄星区竹山居委会四组
            </td>
        </tr>
        <tr>
            <td class="titles">
                身高
            </td>
            <td>
                180
            </td>
            <td class="titles">
                体重
            </td>
            <td>
                180
            </td>
            <td class="titles">
                视力
            </td>
            <td>
                良好
            </td>
            <td class="titles">
                听力
            </td>
            <td>
                良好
            </td>
        </tr>
        <tr>
            <td class="titles">
                银行账户
            </td>
            <td colspan="2">
                123456789132465789
            </td>
            <td class="titles">
                开户行
            </td>
            <td colspan="5">
                中国交通银行娄底市万豪分行
            </td>
        </tr>
        <tr>
            <td class="titles">
                入职时间
            </td>
            <td colspan="2">
                yyyy-MM-dd
            </td>
            <td class="titles">
                身份证号
            </td>
            <td colspan="4">
                123456789013245678
            </td>
        </tr>
        <tr style="height: 80px">
            <td class="titles">
                入职条件
            </td>
            <td colspan="7">
                良好
            </td>
        </tr>
        <tr>
            <td colspan="7" class="titles">
                是否曾被认定为工伤或职业病或持有残疾人证明
            </td>
            <td>
                否
            </td>
        </tr>
        <tr>
            <td colspan="7" class="titles">
                是否从事过井下、高空、高温、特别繁重体力劳动已经有毒有害工种
            </td>
            <td>
                否
            </td>
        </tr>
        <tr>
            <td colspan="4" class="titles">
                是否有传染性疾病以及何疾病
            </td>
            <td>
                否
            </td>
            <td colspan="2" class="titles">
                是否已经休了本年度年休假
            </td>
            <td>
                否
            </td>
        </tr>
        <tr>
            <td colspan="4" class="titles">
                是否曾经或正在追究与承担过刑事责任
            </td>
            <td>
                否
            </td>
            <td colspan="2" class="titles">
                是否在本公司工作过
            </td>
            <td>
                否
            </td>
        </tr>
        <tr>
            <td colspan="5" class="titles">
                是否被劳动能力鉴定委员会鉴定为具有伤残等级以及几何级伤残
            </td>
            <td>
                否
            </td>
            <td class="titles">
                伤残等级
            </td>
            <td>
                一级
            </td>
        </tr>
        <tr>
            <td colspan="5" class="titles">
                最近六个月内所接收的医学治疗于医学检查
            </td>
            <td colspan="3">
                否否否否否否否否否否否否否否
            </td>
        </tr>
        </tbody>
    </table>
    <div style="width: 630px;margin: 10px auto">
        <table border="1px" style="width: 100%">
            <thead>

            <tr>
                <th colspan="6">教育经历</th>
            </tr>
            <tr>
                <th>开始时间</th>
                <th>结束时间</th>
                <th>院校名称</th>
                <th>学历</th>
                <th>专业 </th>
                <th>证书</th>
            </tr>
            </thead>
            <tbody id="oaEntryEducation" style="text-align: center">
                <tr>
                    <td>yyyy-MM-dd</td>
                    <td>yyyy-MM-dd</td>
                    <td>湖南人文科技学院</td>
                    <td>研究生</td>
                    <td>计算机与科学</td>
                    <td>全国比赛一等奖</td>
                </tr>
                <tr>
                    <td>yyyy-MM-dd</td>
                    <td>yyyy-MM-dd</td>
                    <td>湖南人文科技学院</td>
                    <td>研究生</td>
                    <td>计算机与科学</td>
                    <td>全国比赛一等奖</td>
                </tr>
                <tr>
                    <td>yyyy-MM-dd</td>
                    <td>yyyy-MM-dd</td>
                    <td>湖南人文科技学院</td>
                    <td>研究生</td>
                    <td>计算机与科学</td>
                    <td>全国比赛一等奖</td>
                </tr>
            </tbody>
        </table>

    </div>
    <div style="width: 630px;margin: 10px auto">
        <table border="1px" style="width: 100%">
            <thead>
            <tr>
                <th colspan="7">工作经历</th>
            </tr>
            <tr>
                <th>开始时间</th>
                <th>结束时间</th>
                <th>工作单位</th>
                <th>职位</th>
                <th>证明人姓名</th>
                <th>证明人电话</th>
                <th>离职原因</th>
            </tr>
            </thead>
            <tbody id="oaEntryWork" style="text-align: center">
            <tr>
                <td>yyyy-MM-dd</td>
                <td>yyyy-MM-dd</td>
                <td>湖南典卡姆科技有限公司</td>
                <td>软件工程师</td>
                <td>张三三</td>
                <td>12313241234</td>
                <td>个人原因</td>
            </tr>
            <tr>
                <td>yyyy-MM-dd</td>
                <td>yyyy-MM-dd</td>
                <td>湖南典卡姆科技有限公司</td>
                <td>软件工程师</td>
                <td>张三三</td>
                <td>12313241234</td>
                <td>个人原因</td>
            </tr>
            <tr>
                <td>yyyy-MM-dd</td>
                <td>yyyy-MM-dd</td>
                <td>湖南典卡姆科技有限公司</td>
                <td>软件工程师</td>
                <td>张三三</td>
                <td>12313241234</td>
                <td>个人原因</td>
            </tr>
            </tbody>
        </table>
    </div>
    <div style="width: 630px;margin: 10px auto">
        <table border="1px" style="width: 100%">
            <thead>
            <tr>
                <th colspan="5">培训经历</th>
            </tr>
            <tr>
                <th>开始时间</th>
                <th>结束时间</th>
                <th>培训内容</th>
                <th>培训组织机构</th>
                <th>培训结果</th>
            </tr>
            </thead>
            <tbody id="oaEntryTrain" style="text-align: center">
            <tr>
                <td>yyyy-MM-dd</td>
                <td>yyyy-MM-dd</td>
                <td>计算机语言</td>
                <td>北大青鸟</td>
                <td>毕业</td>
            </tr>
            <tr>
                <td>yyyy-MM-dd</td>
                <td>yyyy-MM-dd</td>
                <td>计算机语言</td>
                <td>北大青鸟</td>
                <td>毕业</td>
            </tr>
            <tr>
                <td>yyyy-MM-dd</td>
                <td>yyyy-MM-dd</td>
                <td>计算机语言</td>
                <td>北大青鸟</td>
                <td>毕业</td>
            </tr>
            </tbody>
        </table>
    </div>
    <div style="width: 630px;margin: 10px auto">
        <table border="1px" style="width: 100%">
            <thead>
            <tr>
                <th colspan="4">家庭成员</th>
            </tr>
            <tr>
                <th>姓名</th>
                <th>关系</th>
                <th>工作单位</th>
                <th>所在岗位及职务</th>
            </tr>
            </thead>
            <tbody id="oaEntryFamily" style="text-align: center">
            <tr>
                <td>张三三</td>
                <td>父亲</td>
                <td>湖南典卡姆科技有限公司</td>
                <td>软件工程师</td>
            </tr>
            <tr>
                <td>张三三</td>
                <td>父亲</td>
                <td>湖南典卡姆科技有限公司</td>
                <td>软件工程师</td>
            </tr>
            <tr>
                <td>张三三</td>
                <td>父亲</td>
                <td>湖南典卡姆科技有限公司</td>
                <td>软件工程师</td>
            </tr>
            </tbody>
        </table>
    </div>

    <div style="width: 630px;margin: 10px auto">
        <table border="1px" style="width: 100%">
            <thead>
            <tr>
                <th colspan="5">紧急联系人</th>
            </tr>
            <tr>
                <th>姓名</th>
                <th>关系</th>
                <th>联系地址</th>
                <th>联系邮编</th>
                <th>电话</th>
            </tr>
            </thead>
            <tbody id="oaEmergencyContact" style="text-align: center">
            <tr>
                <td>张三三</td>
                <td>父亲</td>
                <td>湖南省娄底市娄星区经开区某工业园</td>
                <td>417000</td>
                <td>12312341234</td>
            </tr>
            <tr>
                <td>张三三</td>
                <td>父亲</td>
                <td>湖南省娄底市娄星区经开区某工业园</td>
                <td>417000</td>
                <td>12312341234</td>
            </tr>
            <tr>
                <td>张三三</td>
                <td>父亲</td>
                <td>湖南省娄底市娄星区经开区某工业园</td>
                <td>417000</td>
                <td>12312341234</td>
            </tr>
            </tbody>
        </table>
    </div>
    <div style="width: 645px;margin: 10px auto">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">试用期限</label>
                <div class="layui-input-inline">
                    <input autocomplete="off" class="layui-input" id="trialDate"
                           name="trialDate"
                           placeholder="试用期限"
                           type="text">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">试用期工资</label>
                <div class="layui-input-inline">
                    <input autocomplete="off" class="layui-input" id="trialMoney" lay-verify="required"
                           name="trialMoney"
                           placeholder="试用期工资"
                           type="text">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">正式期工资</label>
                <div class="layui-input-inline">
                    <input autocomplete="off" class="layui-input" id="officialMoney" lay-verify="required"
                           name="officialMoney"
                           placeholder="正式期工资"
                           type="text">
                </div>
            </div>
        </div>
    </div>

    <script>
        /*layui.use('table', function(){
            var table = layui.table;

            table.render({
                elem: '#oaEntryEducation'
                , url: getRootPath() + 'oaEntryEducation/selectAll?entryId=743132950945738752'
                , headers: {token: token}
                ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
                , title: '教育经历'
                , parseData: function (res) {
                    if (res.code === 500) {
                        return false
                    }
                    return {
                        "code": res.data.code,
                        "msg": res.data.msg,
                        "count": res.data.count,
                        "data": res.data.data
                    };
                }
                ,cols: [[
                    {type: 'numbers', title: '序列', fixed: 'left'}
                    , {field: 'startTime', title: '开始时间',  templet: function (row) {
                            if (row.startTime) {
                                return dateFormat("yyyy-MM-dd", new Date(row.startTime));
                            } else {
                                return "";
                            }
                        }, width: 102}
                    , {field: 'endTime', title: '结束时间',  templet: function (row) {
                            if (row.endTime) {
                                return dateFormat("yyyy-MM-dd", new Date(row.endTime));
                            } else {
                                return "";
                            }
                        }, width: 102}
                    , {field: 'educationSchool', title: '院校名称', width: 120}
                    , {field: 'educationDegree', title: '学历'}
                    , {field: 'educationMajor', title: '专业', width: 100}
                    , {field: 'educationSeries', title: '证书'}
                ]]
            });

            table.render({
                elem: '#oaEntryWork'
                , url: getRootPath() + 'oaEntryWork/selectAll?entryId=743132950945738752'
                , headers: {token: token}
                , title: '工作经历'
                , parseData: function (res) {
                    if (res.code === 500) {
                        return false
                    }
                    return {
                        "code": res.data.code,
                        "msg": res.data.msg,
                        "count": res.data.count,
                        "data": res.data.data
                    };
                }
                , cols: [[
                    {type: 'numbers', title: '序列', fixed: 'left'}
                    , {field: 'startTime', title: '开始时间',  templet: function (row) {
                            if (row.startTime) {
                                return dateFormat("yyyy-MM-dd", new Date(row.startTime));
                            } else {
                                return "";
                            }
                        }}
                    , {field: 'endTime', title: '结束时间',  templet: function (row) {
                            if (row.endTime) {
                                return dateFormat("yyyy-MM-dd", new Date(row.endTime));
                            } else {
                                return "";
                            }
                        }}
                    , {field: 'workUnit', title: '工作单位'}
                    , {field: 'workPost', title: '职位'}
                    , {field: 'voucher', title: '证明人姓名'}
                    , {field: 'phone', title: '证明人电话'}
                    , {field: 'reasonsForLeaving', title: '离职原因'}
                ]]
            });
        });*/
    </script>

    <!--<div id="entryCheck" style="display: none">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">试用期限</label>
                <div class="layui-input-inline">
                    <input autocomplete="off" class="layui-input" id="trialDate"
                           name="trialDate"
                           placeholder="试用期限"
                           type="text">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">试用期工资</label>
                <div class="layui-input-inline">
                    <input autocomplete="off" class="layui-input" id="trialMoney" lay-verify="required"
                           name="trialMoney"
                           placeholder="试用期工资"
                           type="text">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width: 116px">正式期工资</label>
                <div class="layui-input-inline">
                    <input autocomplete="off" class="layui-input" id="officialMoney" lay-verify="required"
                           name="officialMoney"
                           placeholder="正式期工资"
                           type="text">
                </div>
            </div>
        </div>
    </div>-->

    <!-- 提交-->
    <div class="layui-form-item">
        <!--<div class="layui-input-block" id="flows">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
            <input type="button" class="layui-btn layui-btn-normal" value="暂存"/>
        </div>-->
        <div style="width: 157px;margin: 10px auto" id="flowTwo">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo2">通过</button>
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo3">不通过</button>
        </div>
    </div>
</form>
<script type="text/html" id="barDemoOaEntryEducation">
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delOaEntryEducation">删除</a>
</script>
<script type="text/html" id="barDemoOaEntryWork">
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delEntryWork">删除</a>
</script>
<script type="text/html" id="barDemoOaEntryTrain">
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delEntryTrain">删除</a>
</script>
<script type="text/html" id="barDemoOaEntryFamily">
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delEntryFamily">删除</a>
</script>
<script type="text/html" id="barDemoEmergencyContact">
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delEmergencyContact">删除</a>
</script>
<script>
    /*let oaEntryEducationTable; // 教育经历
    let oaEntryWorkTable; //工作经历
    let oaEntryTrainTable; //培训经历
    let oaEntryFamilyTable; // 家庭成员
    let oaEmergencyContactTable; // 紧急联络人
    let pkEntryId = getQueryString("pkEntryId");
    layui.use(['form', 'laydate', 'table'], function () {
        var table = layui.table;
        var form = layui.form
            , layer = layui.layer
            , laydate = layui.laydate;


        //身份证验证
        $("#entryIdentity").on('blur', function () {
            console.info($("#entryIdentity").val());
            if ($("#entryIdentity").val().length !== 18) {
                layer.alert("请输入正确的身份证号", {
                    icon: 2,
                }, function () {
                    layer.msg('请重新输入', {icon: 0});
                    $("#entryIdentity").val("");
                    $("#entryIdentity").focus();
                });

            }
        });


        if (pkEntryId) {
            $("#flows").hide();
            $("#entryArea").attr("disabled", ""); // 姓名
            $("#entryBirthday").attr("disabled", ""); // 生日
            $("#entryIdentity").attr("disabled", ""); // 身份证
            $("#entryNation").attr("disabled", ""); // 民族
            $("#entryNativeProvince").attr("disabled", ""); // 籍贯
            $("#entryPostcode").attr("disabled", ""); // 邮编
            $("#entryPhone").attr("disabled", ""); // 电话
            $("#entryEducation").attr("disabled", ""); // 最高学历
            $("#entryMajor").attr("disabled", ""); // 专业
            $("#entryForeignLevel").attr("disabled", ""); // 外语及等级
            $("#entryProfessionalQualification").attr("disabled", ""); // 职业资格
            $("#entryMajorQualification").attr("disabled", ""); // 专业职称
            $("#entryBankAccount").attr("disabled", ""); // 银行账户
            $("#entryBankName").attr("disabled", ""); // 开户行
            $("#entrySexMan").attr("disabled", ""); // 性别男
            $("#entrySexGirl").attr("disabled", ""); // 性别女
            $("#entryNativeCity").attr("disabled", ""); // 户口所在地
            $("#isMarriage0").attr("disabled", ""); // 婚姻状况 已婚
            $("#isMarriage1").attr("disabled", ""); // 婚姻状况 未婚
            $("#isMarriage2").attr("disabled", ""); // 婚姻状况 离异
            $("#isMarriage3").attr("disabled", ""); // 婚姻状况 再婚
            $("#entryCurrentResidence").attr("disabled", ""); // 现住地址
            $("#entryCommunicationResidence").attr("disabled", ""); // 通信地址
            $("#healthHeight").attr("disabled", ""); // 身高
            $("#healthWeight").attr("disabled", ""); // 体重
            $("#dimissionTime").attr("disabled", ""); // 参加工作时间
            $("#accumulativeDate").attr("disabled", ""); // 累计工作时间
            $("#recruitmentInformation").attr("disabled", ""); // 应聘信息来源
            $("#departmentId").attr("disabled", ""); // 入职部门
            $("#postId").attr("disabled", ""); // 入职岗位
            $("#affirmTime").attr("disabled", ""); // 入职时间
            $("#isHealthEyesight0").attr("disabled", ""); // 视力 辅助
            $("#isHealthEyesight1").attr("disabled", ""); // 视力 良好
            $("#isHealthEar0").attr("disabled", ""); // 听力 辅助
            $("#isHealthEar1").attr("disabled", ""); // 听力 良好
            $("#employCondition").attr("disabled", ""); // 录用条件
            $("#isHealthInjury").attr("disabled", ""); // 工伤
            $("#isHealthHeavyManual").attr("disabled", ""); // 高危工作
            $("#isHealthContagion").attr("disabled", ""); // 传染疾病
            $("#isAnnualVacation").attr("disabled", ""); // 是否休完年假
            $("#isPenal").attr("disabled", ""); // 刑事记录
            $("#formeWork").attr("disabled", ""); // 本公司工作过
            $("#isHealthMaim").attr("disabled", ""); // 伤残
            $("#healthMaimGrade").attr("disabled", ""); // 伤残等级
            $("#reson").attr("disabled", ""); // 医学治疗
            $("#pkEntryId").val(pkEntryId);

        } else {
            $("#flowTwo").hide();
            const res = getAjaxById(getRootPath() + "oaEntryFlowAction/addEntryFlow");
            console.info(res);
            $("#pkEntryId").val(res.pkEntryId);
            $("#isRevision").val(res.isRevision);
        }
        //点击教育经历的监听方法
        $("#education").on("click", function () {
            layer.open({
                type: 2,
                title: '增加操作',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['90%', '90%'],
                content: 'education/education.html?id=' + $("#pkEntryId").val()
            });
        });
        //点击工作经历的监听方法
        $("#entrywork").on("click", function () {
            layer.open({
                type: 2,
                title: '增加操作',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['90%', '90%'],
                content: 'entrywork/entrywork.html?id=' + $("#pkEntryId").val()
            });
        });
        //点击培训经历的监听方法
        $("#entryTrain").on("click", function () {
            layer.open({
                type: 2,
                title: '增加操作',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['90%', '90%'],
                content: 'entryTrain/entryTrain.html?id=' + $("#pkEntryId").val()
            });
        });
        //监听家庭成员
        $("#entryFamily").on("click", function () {
            layer.open({
                type: 2,
                title: '增加操作',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['90%', '90%'],
                content: 'entryfamily/entryfamily.html?id=' + $("#pkEntryId").val()
            });
        });
        //监听新增紧急联系人
        $("#emergencyContact").on("click", function () {
            layer.open({
                type: 2,
                title: '增加操作',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['90%', '90%'],
                content: 'emergencyContact/emergencyContact.html?id=' + $("#pkEntryId").val()
            });
        });

        //出生日期
        laydate.render({
            elem: '#entryBirthday'
        });
        //参加工作时间
        laydate.render({
            elem: '#dimissionTime'
        });
        //入职日期
        laydate.render({
            elem: '#affirmTime'
        });

        //加载民族下拉框
        const nation = getAjaxById(getRootPath() + "OaDataDictionaryAction/findKeyword/NATION");
        $("#entryNation").html('<option value="">请选择民族</option>');
        $.each(nation, function (index, item) {
            $("#entryNation").append('<option value="' + item.pkDataDictionaryId + '">' + item.dataDictionaryName + '</option>')
        });

        //加载学历下拉框
        const education = getAjaxById(getRootPath() + "OaDataDictionaryAction/findKeyword/EDUCATION");
        $("#entryEducation").html('<option value="">请选择学历</option>');
        $.each(education, function (index, item) {
            $("#entryEducation").append('<option value="' + item.pkDataDictionaryId + '">' + item.dataDictionaryName + '</option>')
        });

        //加载部门下拉框
        const departmentId = getAjaxById(getRootPath() + "OaDepartmentAction/departmentfindByAll");
        $("#departmentId").html('<option value="">请选择部门</option>');
        $.each(departmentId.data, function (index, item) {
            $("#departmentId").append('<option value="' + item.pkDepartmentId + '">' + item.departmentName + '</option>')
        });

        form.on('select(departmentId)', function (data) {
            if (data.value) {
                //加载岗位下拉框
                const postId = getAjaxById(getRootPath() + "OaOrganizationAction/organizationFind/" + data.value);
                $("#postId").html('<option value="">请选择岗位</option>');
                $.each(postId.data, function (index, item) {
                    $("#postId").append('<option value="' + item.pkPostId + '">' + item.postName + '</option>')
                });
            } else {
                $("#postId").html('<option value="">请选择岗位</option>');
            }
            form.render();
        });

        //加载应聘信息来源下拉框
        const recruitmentInformation = getAjaxById(getRootPath() + "OaDataDictionaryAction/findKeyword/ORIGIN");
        $("#recruitmentInformation").html('<option value="">请选择应聘来源</option>');
        $.each(recruitmentInformation, function (index, item) {
            $("#recruitmentInformation").append('<option value="' + item.pkDataDictionaryId + '">' + item.dataDictionaryName + '</option>')
        });

        //加载应聘信息来源下拉框
        const healthMaimGrade = getAjaxById(getRootPath() + "OaDataDictionaryAction/findKeyword/MAIM");
        $("#healthMaimGrade").html('<option value="">请选择伤残等级</option>');
        $.each(healthMaimGrade, function (index, item) {
            $("#healthMaimGrade").append('<option value="' + item.pkDataDictionaryId + '">' + item.dataDictionaryName + '</option>')
        });
        //监听指定开关
        form.on('switch(switchTest)', function (data) {
            /!*layer.msg('开关checked：'+ (this.checked ? 'true' : 'false'), {
                offset: '6px'
            });*!/
            if (this.checked) {
                $("#isHealthMaimLevel").show();
                $("#isHealthMaims").css("width", "655px");
            } else {
                $("#isHealthMaimLevel").hide();
                $("#isHealthMaims").css("width", "520px");
                $("#healthMaimGrade").val("");
            }
        });
        oaEntryEducationTable = table.render({
            elem: '#oaEntryEducation'
            , url: getRootPath() + 'oaEntryEducation/selectAll?entryId=' + $("#pkEntryId").val()
            , headers: {token: token}
            , title: '教育经历'
            , parseData: function (res) {
                if (res.code === 500) {
                    return false
                }
                return {
                    "code": res.data.code,
                    "msg": res.data.msg,
                    "count": res.data.count,
                    "data": res.data.data
                };
            }
            , cols: [[
                {type: 'numbers', title: '序列', fixed: 'left', width: 120}
                , {
                    field: 'startTime', title: '开始时间', templet: function (row) {
                        if (row.startTime) {
                            return dateFormat("yyyy-MM-dd", new Date(row.startTime));
                        } else {
                            return "";
                        }
                    }, width: 120
                }
                , {
                    field: 'endTime', title: '结束时间', templet: function (row) {
                        if (row.endTime) {
                            return dateFormat("yyyy-MM-dd", new Date(row.endTime));
                        } else {
                            return "";
                        }
                    }, width: 120
                }
                , {field: 'educationSchool', title: '院校名称', width: 120}
                , {field: 'educationDegree', title: '学历', width: 120}
                , {field: 'educationMajor', title: '专业', width: 120}
                , {field: 'educationSeries', title: '证书', width: 120}
                , {fixed: 'right', title: '操作', toolbar: '#barDemoOaEntryEducation', width: 120}
            ]]
        });
        //监听行工具事件
        table.on('tool(oaEntryEducation)', function (obj) {
            var data = obj.data;
            if (obj.event === 'delOaEntryEducation') {
                layer.confirm('真的删除行么', function (index) {
                    var url = getRootPath() + 'oaEntryEducation/delete/' + data.pkEducationId;
                    var dataOne = deleteAjaxById(url);
                    if (dataOne.code === 1) {
                        oaEntryEducationTable.reload();
                        layer.msg('删除成功', {icon: 1});
                    } else {
                        layer.msg("删除失败")
                    }
                });
            }
        });

        oaEntryWorkTable = table.render({
            elem: '#oaEntryWork'
            , url: getRootPath() + 'oaEntryWork/selectAll?entryId=' + $("#pkEntryId").val()
            , headers: {token: token}
            , title: '工作经历'
            , parseData: function (res) {
                if (res.code === 500) {
                    return false
                }
                return {
                    "code": res.data.code,
                    "msg": res.data.msg,
                    "count": res.data.count,
                    "data": res.data.data
                };
            }
            , cols: [[
                {type: 'numbers', title: '序列', fixed: 'left'}
                , {
                    field: 'startTime', title: '开始时间', templet: function (row) {
                        if (row.startTime) {
                            return dateFormat("yyyy-MM-dd", new Date(row.startTime));
                        } else {
                            return "";
                        }
                    }
                }
                , {
                    field: 'endTime', title: '结束时间', templet: function (row) {
                        if (row.endTime) {
                            return dateFormat("yyyy-MM-dd", new Date(row.endTime));
                        } else {
                            return "";
                        }
                    }
                }
                , {field: 'workUnit', title: '工作单位'}
                , {field: 'workPost', title: '职位'}
                , {field: 'voucher', title: '证明人姓名'}
                , {field: 'phone', title: '证明人电话'}
                , {field: 'reasonsForLeaving', title: '离职原因'}
                , {fixed: 'right', title: '操作', toolbar: '#barDemoOaEntryWork', width: 120}
            ]]
        });
        //监听行工具事件
        table.on('tool(oaEntryWork)', function (obj) {
            var data = obj.data;
            if (obj.event === 'delEntryWork') {
                layer.confirm('真的删除行么', function (index) {
                    var url = getRootPath() + 'oaEntryWork/delete/' + data.pkWorkId;
                    var dataOne = deleteAjaxById(url);
                    if (dataOne.code === 1) {
                        oaEntryWorkTable.reload();
                        layer.msg('删除成功', {icon: 1});
                    } else {
                        layer.msg("删除失败")
                    }
                });
            }
        });
        oaEntryTrainTable = table.render({
            elem: '#oaEntryTrain'
            , url: getRootPath() + 'oaEntryTrain/selectAll?entryId=' + $("#pkEntryId").val()
            , headers: {token: token}
            , title: '培训经历'
            , parseData: function (res) {
                if (res.code === 500) {
                    return false
                }
                return {
                    "code": res.data.code,
                    "msg": res.data.msg,
                    "count": res.data.count,
                    "data": res.data.data
                };
            }
            , cols: [[
                {type: 'numbers', title: '序列', fixed: 'left'}
                , {
                    field: 'startTime', title: '开始时间', templet: function (row) {
                        if (row.startTime) {
                            return dateFormat("yyyy-MM-dd", new Date(row.startTime));
                        } else {
                            return "";
                        }
                    }
                }
                , {
                    field: 'endTime', title: '结束时间', templet: function (row) {
                        if (row.endTime) {
                            return dateFormat("yyyy-MM-dd", new Date(row.endTime));
                        } else {
                            return "";
                        }
                    }
                }
                , {field: 'trainContent', title: '培训内容'}
                , {field: 'trainInstitutional', title: '培训组织机构'}
                , {field: 'trainResult', title: '培训结果'}
                , {fixed: 'right', title: '操作', toolbar: '#barDemoOaEntryTrain', width: 220}
            ]]
        });
        //监听行工具事件
        table.on('tool(oaEntryTrain)', function (obj) {
            var data = obj.data;
            if (obj.event === 'delEntryTrain') {
                layer.confirm('真的删除行么', function (index) {
                    var url = getRootPath() + 'oaEntryTrain/delete/' + data.pkTrainId;
                    var dataOne = deleteAjaxById(url);
                    if (dataOne.code === 1) {
                        oaEntryWorkTable.reload();
                        layer.msg('删除成功', {icon: 1});
                    } else {
                        layer.msg("删除失败")
                    }
                });
            }
        });
        oaEntryFamilyTable = table.render({
            elem: '#oaEntryFamily'
            , url: getRootPath() + 'oaEntryFamily/selectAll?entryId=' + $("#pkEntryId").val()
            , headers: {token: token}
            , title: '家庭成员'
            , parseData: function (res) {
                if (res.code === 500) {
                    return false
                }
                return {
                    "code": res.data.code,
                    "msg": res.data.msg,
                    "count": res.data.count,
                    "data": res.data.data
                };
            }
            , cols: [[
                {type: 'numbers', title: '序列', fixed: 'left'}
                , {field: 'familyName', title: '姓名'}
                , {field: 'relation', title: '关系'}
                , {field: 'familyEmployer', title: '工作单位'}
                , {field: 'post', title: '所在岗位及职务'}
                , {fixed: 'right', title: '操作', toolbar: '#barDemoOaEntryFamily', width: 220}
            ]]
        });
        //监听行工具事件
        table.on('tool(oaEntryFamily)', function (obj) {
            var data = obj.data;
            console.log(data)
            if (obj.event === 'delEntryFamily') {
                layer.confirm('真的删除行么', function (index) {
                    var url = getRootPath() + 'oaEntryFamily/delete/' + data.pkFamilyId;
                    var dataOne = deleteAjaxById(url);
                    if (dataOne.code === 1) {
                        oaEntryWorkTable.reload();
                        layer.msg('删除成功', {icon: 1});
                    } else {
                        layer.msg("删除失败")
                    }
                });
            }
        });
        oaEmergencyContactTable = table.render({
            elem: '#oaEmergencyContact'
            , url: getRootPath() + 'oaEmergencyContact/selectAll?entryId=' + $("#pkEntryId").val()
            , headers: {token: token}
            , title: '紧急联络人'
            , parseData: function (res) {
                if (res.code === 500) {
                    return false
                }
                return {
                    "code": res.data.code,
                    "msg": res.data.msg,
                    "count": res.data.count,
                    "data": res.data.data
                };
            }
            , cols: [[
                {type: 'numbers', title: '序列', fixed: 'left'}
                , {field: 'emergencyContactName', title: '姓名'}
                , {field: 'relation', title: '关系'}
                , {field: 'emergencyContactAddress', title: '联系地址'}
                , {field: 'emergencyContactPostcode', title: '联系邮编'}
                , {field: 'emergencyContactPhone', title: '电话'}
                , {fixed: 'right', title: '操作', toolbar: '#barDemoEmergencyContact', width: 220}
            ]]
        });
        //监听行工具事件
        table.on('tool(oaEmergencyContact)', function (obj) {
            var data = obj.data;
            if (obj.event === 'delEmergencyContact') {
                layer.confirm('真的删除行么', function (index) {
                    var url = getRootPath() + 'oaEmergencyContact/delete/' + data.emergencyContactId;
                    var dataOne = deleteAjaxById(url);
                    if (dataOne.code === 1) {
                        oaEmergencyContactTable.reload();
                        layer.msg('删除成功', {icon: 1});
                    } else {
                        layer.msg("删除失败")
                    }
                });
            }
        });
        //监听起草提交
        form.on('submit(demo1)', function (data) {
            //是否曾被认定为工伤或职业病或持有残疾人证明
            if ($("#isHealthInjury").prop("checked")) {
                data.field.isHealthInjury = "0";
            } else {
                data.field.isHealthInjury = "1";
            }
            //是否从事过井下、高空、高温、特别繁重体力劳动已经有毒有害工种
            if ($("#isHealthHeavyManual").prop("checked")) {
                data.field.isHealthHeavyManual = "0";
            } else {
                data.field.isHealthHeavyManual = "1";
            }
            //是否有传染性疾病以及何疾病
            if ($("#isHealthContagion").prop("checked")) {
                data.field.isHealthContagion = "0";
            } else {
                data.field.isHealthContagion = "1";
            }
            //是否已经休了本年度年休假
            if ($("#isAnnualVacation").prop("checked")) {
                data.field.isAnnualVacation = "0";
            } else {
                data.field.isAnnualVacation = "1";
            }
            //是否曾经或正在追究与承担过刑事责任
            if ($("#isPenal").prop("checked")) {
                data.field.isPenal = "0";
            } else {
                data.field.isPenal = "1";
            }
            //是否在本公司工作过
            if ($("#formeWork").prop("checked")) {
                data.field.formeWork = "0";
            } else {
                data.field.formeWork = "1";
            }
            //是否被劳动能力鉴定委员会鉴定为具有伤残等级以及几何级伤残
            if ($("#isHealthMaim").prop("checked")) {
                data.field.isHealthMaim = "0";
            } else {
                data.field.isHealthMaim = "1";
            }

            console.info(data.field);
            const res = postAjax(getRootPath() + "oaEntryFlowAction/addOrUpdate", data.field);
            if (res.code === 1) {
                window.location.reload();//刷新页面
            } else if (res.code === 500) {
                error('500');
            } else {
                layer.msg("新增失败");
            }
            return false;
        });
        //监听审核提交
        form.on('submit(demo2)', function (data) {
            console.info(data.field);
            if ($("#isHealthInjury").prop("checked")) {
                data.field.isHealthInjury = "0";
            } else {
                data.field.isHealthInjury = "1";
            }
            console.info(data.field);
            return false;
            const res = postAjax(getRootPath() + "", data.field);
            if (res.code === 1) {
                window.parent.location.reload();//刷新父页面
                const index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                parent.layer.close(index);
            } else if (res.code === 500) {
                error('500');
            } else {
                layer.msg("新增失败");
            }
            return false;
        });
        //监听提交
        form.on('submit(demo3)', function (data) {
            console.info(data.field);
            if ($("#isHealthInjury").prop("checked")) {
                data.field.isHealthInjury = "0";
            } else {
                data.field.isHealthInjury = "1";
            }
            console.info(data.field);
            return false;
            const res = postAjax(getRootPath() + "", data.field);
            if (res.code === 1) {
                window.parent.location.reload();//刷新父页面
                const index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                parent.layer.close(index);
            } else if (res.code === 500) {
                error('500');
            } else {
                layer.msg("新增失败");
            }
            return false;
        });

        if (isButton("ENTRY_CHECK") && $("#isRevision").val() == "L") {
            $("#entryCheck").show();
            $("#trialDate").attr("lay-verify", "required");
            $("#trialMoney").attr("lay-verify", "required");
            $("#officialMoney").attr("lay-verify", "required");
        }

        form.render();
    });*/
</script>
</body>
</html>